/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package ca.trader.user;

import ca.trader.db.UserPendingActivationTableConstraints;
import java.io.Serializable;
import java.util.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.OneToOne;
import javax.persistence.PrePersist;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 It contains: 
* <ol>
* <li>
* </li>
* <li>
* </li>
* </ol>
 * @author W4L3
 */
@Entity
public class UserActivationDesc implements Serializable
{

	 @Id
	 @Column(nullable = false, length = UserPendingActivationTableConstraints.CONSTRAINT_ACTIVATION_ID_MAX_LENGTH)
	 private String activationID;
	 
	 @OneToOne
	 @JoinColumn(nullable = false)
	 private User user;
	 
	 @Column(nullable = false)
	 @Temporal(TemporalType.TIME)
	 Date registeredDate;

	 public String getActivationID()
	 {
		  return activationID;
	 }

	 public void setActivationID(String activationID)
	 {
		  this.activationID = activationID;
	 }

	 public User getUser()
	 {
		  return user;
	 }

	 public void setUser(User user)
	 {
		  this.user = user;
	 }

	 @PrePersist
	 private void onCreate()
	 {
		  registeredDate = new Date();
	 }

	 public Date getRegisteredDate()
	 {
		  return registeredDate;
	 }

}
